if (!require("dplyr")) {install.packages("dplyr"); require("dplyr")}
if (!require("Seurat")) {install.packages("Seurat"); require("Seurat")}
if (!require("SeuratDisk")) {install.packages("SeuratDisk"); require("SeuratDisk")}
if (!require("knitr")) {install.packages("knitr"); require("knitr")}
if (!require("ggplot2")) {install.packages("ggplot2"); require("ggplot2")}
if (!requireNamespace('BiocManager', quietly = TRUE)) {install.packages('BiocManager'); require("BiocManager")}
if (!require("here")) {install.packages("here"); require("here")}
if (!require("paletteer")) {install.packages("paletteer"); require("paletteer")} # color palette
if (!require("grDevices")) {install.packages("grDevices"); require("grDevices")} # for grDevices palette
if (!require("tidyverse")) {install.packages("tidyverse"); require("tidyverse")} # for data frame transformation
if (!require("tibble")) {install.packages("tibble"); require("tibble")} # for table transformation
if (!require("geneName")) {install.packages("geneName"); require("geneName")}
if (!require("ggrepel")) {install.packages("ggrepel"); require("ggrepel")}
if (!require("gghighlight")) {install.packages("gghighlight"); require("gghighlight")}
if (!require("ggpmisc")) {install.packages("ggpmisc"); require("ggpmisc")}
if (!require("ggupset")) {install.packages("ggupset"); require("ggupset")}
if (!require("RColorBrewer")) {install.packages("RColorBrewer"); require("RColorBrewer")}
if (!require("viridis")) {install.packages("viridis"); require("viridis")}
library(SeuratData)
library(openxlsx)
library(gplots)
library(ggvenn)This file was made to explore the expression of MTAP and APRT in the KPMP dataset in Healthy vs. AKI/CKD as well as after subsetting PT cells and classifying based on expression of KIM1 (HAVCR1).
In the 2024 KPMP scRNAseq (and I think also in the snRNAseq file) there is some mismatch between the subclass.l1 and subclass.l2 annotations. For example, subsetting subclass.l1 == “PT” and then looking at subclass.l2, there are some cells that are not PT.
Working with the KPMP scRNAseq file: PREMIERE_Alldatasets_08132021.h5Seurat
## [1] "2024-12-08 13:49:16 PST"
## [1] "2024-12-08 13:50:35 PST"
## An object of class Seurat
## 30395 features across 110346 samples within 1 assay
## Active assay: RNA (30395 features, 5000 variable features)
## 3 layers present: counts, data, scale.data
## 3 dimensional reductions calculated: harmony, pca, umap
meta <- read.csv(here("OpenAccessClinicalData.csv"))
df <- FetchData(KPMP, "SpecimenID") %>% rownames_to_column(var = "CellID")
df <- left_join(df, meta, by = c("SpecimenID" = "Participant.ID")) %>% column_to_rownames(var = "CellID")
KPMP <- AddMetaData(KPMP, df)
head(KPMP@meta.data)## [1] "AKI" "CKD" "Healthy Reference"
VlnPlot(KPMP, features = "MTAP", group.by = "subclass.l1") + ggtitle("MTAP Expression in all cells")VlnPlot(KPMP, features = "MTAP", group.by = "subclass.l1") + ggtitle("MTAP Expression in all cells")VlnPlot(KPMP, features = "APRT", group.by = "subclass.l1") + ggtitle("APRT Expression in all cells")DotPlot(
KPMP,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "subclass.l1",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("MTAP Expression in all cells")DotPlot(
KPMP,
assay = NULL,
features = c("APRT"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "subclass.l1",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("APRT Expression in all cells")VlnPlot(KPMP, features = "MTAP", group.by = "Enrollment.Category", pt.size = 0.1) + ggtitle("MTAP in all cells")VlnPlot(KPMP, features = "MTAP", idents = "PT", group.by = "Enrollment.Category", pt.size = 0.1) + ggtitle("MTAP in PT cells")DotPlot(
KPMP,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("MTAP in all cells")DotPlot(
KPMP,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = "PT",
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("MTAP in PT cells")VlnPlot(KPMP, features = "APRT", group.by = "Enrollment.Category", pt.size = 0.1) + ggtitle("APRT in all cells")VlnPlot(KPMP, features = "APRT", idents = "PT", group.by = "Enrollment.Category", pt.size = 0.1) + ggtitle("APRT in PT cells")DotPlot(
KPMP,
assay = NULL,
features = c("APRT"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("APRT in all cells")DotPlot(
KPMP,
assay = NULL,
features = c("APRT"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = "PT",
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("APRT in PT cells")Kim1 = HAVCR1
KPMP_PT <- subset(KPMP, idents = c("PT"))
DimPlot(KPMP_PT, group.by = "subclass.l2") + ggtitle("KPMP PT cells")VlnPlot(KPMP_PT, features = "HAVCR1", group.by = "subclass.l2", pt.size = 0.1) + ggtitle("HAVCR1 in PT cells")VlnPlot(KPMP_PT, features = "HAVCR1", group.by = "subclass.l2", split.by = "Enrollment.Category", pt.size = 0.1) + ggtitle("HAVCR1 in PT cells")KPMP_PT@meta.data$KIM1status <- ifelse(GetAssayData(KPMP_PT, assay = "RNA", slot = "data")["HAVCR1", ] > 0, "yes", "no")
DimPlot(KPMP_PT, group.by = "KIM1status", label = T)##
## dVSMC aPT dC-TAL dCNT-PC dEC-PTC dPC dIC-A dCNT dDCT dPT dPT/DTL aTAL2
## no 0 9400 0 0 0 0 0 0 0 5731 2256 0
## yes 0 478 0 0 0 0 0 0 0 56 167 0
##
## aTAL1 ncMON tPC-IC FIB MyoF VSMC/P MC aFIB PEC POD PT-S1/S2 PT-S3
## no 0 0 0 0 0 0 0 0 0 0 7037 181
## yes 0 0 0 0 0 0 0 0 0 0 4 0
##
## cycEPI DTL1 C-TAL M-TAL DCT1 CNT CNT-PC PC CNT-IC-A IC-A IC-B EC-AEA
## no 212 0 0 0 0 0 0 0 0 0 0 0
## yes 7 0 0 0 0 0 0 0 0 0 0 0
##
## EC-GC EC-LYM EC-PTC cycEC REN MAC-M2 MAST MDC cDC pDC MON cycMNP
## no 0 0 0 0 0 0 0 0 0 0 0 0
## yes 0 0 0 0 0 0 0 0 0 0 0 0
##
## T-REG T-CYT NKT NK1 NK2 T cycT B PL
## no 0 0 0 0 0 0 0 0 0
## yes 0 0 0 0 0 0 0 0 0
##
## Healthy Reference AKI CKD
## no 5137 7916 11764
## yes 22 357 333
VlnPlot(KPMP_PT, features = "MTAP", group.by = "KIM1status", pt.size = 0.1) + ggtitle("MTAP in PT cells by KIM1 Expression")DotPlot(
KPMP_PT,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = "PT",
group.by = "KIM1status",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("MTAP in PT cells by KIM1 Expression")VlnPlot(KPMP_PT, features = "APRT", group.by = "KIM1status", pt.size = 0.1) + ggtitle("APRT in PT cells by KIM1 Expression")DotPlot(
KPMP_PT,
assay = NULL,
features = c("APRT"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = "PT",
group.by = "KIM1status",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("APRT in PT cells by KIM1 Expression")Idents(KPMP_PT) <- KPMP_PT@meta.data$Enrollment.Category
KPMP_PT2 <- subset(KPMP_PT, idents = c("AKI"))
DimPlot(KPMP_PT2, group.by = "subclass.l2") + ggtitle("KPMP AKI PT cells")VlnPlot(KPMP_PT2, features = "HAVCR1", group.by = "subclass.l2", pt.size = 0.1) + ggtitle("HAVCR1 in AKI PT cells")##
## dVSMC aPT dC-TAL dCNT-PC dEC-PTC dPC dIC-A dCNT dDCT dPT dPT/DTL aTAL2
## no 0 2987 0 0 0 0 0 0 0 3541 936 0
## yes 0 239 0 0 0 0 0 0 0 44 67 0
##
## aTAL1 ncMON tPC-IC FIB MyoF VSMC/P MC aFIB PEC POD PT-S1/S2 PT-S3
## no 0 0 0 0 0 0 0 0 0 0 216 76
## yes 0 0 0 0 0 0 0 0 0 0 1 0
##
## cycEPI DTL1 C-TAL M-TAL DCT1 CNT CNT-PC PC CNT-IC-A IC-A IC-B EC-AEA
## no 160 0 0 0 0 0 0 0 0 0 0 0
## yes 6 0 0 0 0 0 0 0 0 0 0 0
##
## EC-GC EC-LYM EC-PTC cycEC REN MAC-M2 MAST MDC cDC pDC MON cycMNP
## no 0 0 0 0 0 0 0 0 0 0 0 0
## yes 0 0 0 0 0 0 0 0 0 0 0 0
##
## T-REG T-CYT NKT NK1 NK2 T cycT B PL
## no 0 0 0 0 0 0 0 0 0
## yes 0 0 0 0 0 0 0 0 0
##
## Healthy Reference AKI CKD
## no 0 7916 0
## yes 0 357 0
VlnPlot(KPMP_PT2, features = "MTAP", group.by = "KIM1status", pt.size = 0.1) + ggtitle("MTAP in AKI PT cells by KIM1 Expression")DotPlot(
KPMP_PT2,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "KIM1status",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("MTAP in AKI PT cells by KIM1 Expression")VlnPlot(KPMP_PT2, features = "APRT", group.by = "KIM1status", pt.size = 0.1) + ggtitle("APRT in AKI PT cells by KIM1 Expression")DotPlot(
KPMP_PT2,
assay = NULL,
features = c("APRT"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
idents = NULL,
group.by = "KIM1status",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() + ggtitle("APRT in AKI PT cells by KIM1 Expression")## [1] "DTL" "Interstitial" "Immune" "ATL/TAL" "EC"
## [6] "PC" "PT" "TAL" "IC" "CNT"
## [11] "DCT" "PEC" "POD"
KPMP@meta.data$subclass.l1 <- factor(KPMP@meta.data$subclass.l1, levels = c("PT", "DTL", "ATL/TAL", "TAL", "DCT", "CNT", "PC", "IC", "POD", "PEC", "EC", "Interstitial", "Immune"))
DimPlot(KPMP, group.by = "subclass.l1") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20))KPMP_subset <- subset(KPMP, idents = c("PT"))
DimPlot(KPMP_subset, group.by = "subclass.l1") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20))Idents(KPMP_subset) <- KPMP_subset@meta.data$Enrollment.Category
KPMP_subset <- subset(x = KPMP_subset, idents = c("Healthy Reference", "AKI"))
DimPlot(KPMP_subset, group.by = "subclass.l1", split.by = "Enrollment.Category") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20))DimPlot(KPMP_subset, group.by = "subclass.l2") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20))KPMP_subset@meta.data$subclass.l2 <- factor(KPMP_subset@meta.data$subclass.l2, levels = c("PT-S1/S2", "PT-S3", "aPT", "dPT", "dPT/DTL", "cycEPI"))
DimPlot(KPMP_subset, group.by = "subclass.l2") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20))
## Figure 1
DimPlot(KPMP, group.by = "subclass.l1") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20))DimPlot(KPMP_subset, group.by = "subclass.l2") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20))VlnPlot(
object = KPMP_subset,
features = "MTAP",
group.by = "subclass.l2",
split.by = "Enrollment.Category"
) +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ylab("MTAP Expression") +
ggtitle("MTAP Expression Across PT Cells")VlnPlot(
object = KPMP_subset,
features = "HAVCR1",
group.by = "subclass.l2",
split.by = "Enrollment.Category"
) +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ylab("HAVCR1 Expression") +
ggtitle("HAVCR1 Expression Across PT Cells")DotPlot(
KPMP_subset,
assay = NULL,
features = c("MTAP", "HAVCR1"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ggtitle("HAVCR1 and MTAP Expression") +
xlab(label = "")KPMP_subset@meta.data$KIM1status <- ifelse(GetAssayData(KPMP_subset, assay = "RNA", slot = "data")["HAVCR1", ] > 0, "yes", "no")
DimPlot(KPMP_subset, group.by = "KIM1status", order = T) + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20),
plot.title = element_text(hjust = 0.5)) +
ggtitle("PT Cells Categorized by KIM1 Expression")FeaturePlot(KPMP_subset, "HAVCR1", order = T) + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20),
plot.title = element_text(hjust = 0.5))+
ggtitle("KIM1 Expression")DotPlot(
KPMP_subset,
assay = "RNA", # Specify the assay explicitly if applicable
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
group.by = "KIM1status",
split.by = NULL,
cluster.idents = FALSE,
scale = TRUE,
scale.by = "radius"
) +
coord_flip() +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_text(size = 20, colour = "black"),
axis.title.y = element_text(size = 15, colour = "black"), # Force y-axis title
axis.text.x = element_text(size = 25, colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ggtitle("MTAP Expression Based on KIM1 Expression") +
ylab("Does Cell Express KIM1?") +
xlab("")KPMP@meta.data$subclass.l1 <- factor(KPMP@meta.data$subclass.l1, levels = c("PT", "DTL", "ATL/TAL", "TAL", "DCT", "CNT", "PC", "IC", "POD", "PEC", "EC", "Interstitial", "Immune"))
Idents(KPMP) <- KPMP@meta.data$Enrollment.Category
KPMP_subset2 <- subset(x = KPMP, idents = c("Healthy Reference", "AKI"))
DimPlot(KPMP_subset2, group.by = "subclass.l1") + ggtitle(NULL) + xlab("UMAP 1") + ylab("UMAP 2") +
theme_classic() +
theme(axis.line = element_line(size = 1, colour = "black"),
text = element_text(size=20)) +
theme(axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20),
plot.title = element_text(hjust = 0.5)) +
ggtitle("Healthy Reference and AKI Cells")DotPlot(
KPMP_subset2,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
group.by = "Enrollment.Category",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ggtitle("MTAP Expression by Disease") +
xlab(label = "")KPMP_subset3 <- subset(x = KPMP, idents = c("Healthy Reference"))
KPMP_subset4 <- subset(x = KPMP, idents = c("AKI"))
DotPlot(
KPMP_subset3,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
group.by = "subclass.l1",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(angle = 45, hjust = 1, colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ggtitle("MTAP Expression by Cell Type in Healthy Reference") +
xlab(label = "")DotPlot(
KPMP_subset4,
assay = NULL,
features = c("MTAP"),
cols = c("lightgrey", "blue"),
col.min = -2.5,
col.max = 2.5,
dot.min = 0,
dot.scale = 6,
group.by = "subclass.l1",
split.by = NULL,
cluster.idents = FALSE,
scale = T,
scale.by = "radius",
scale.min = NA,
scale.max = NA
) + coord_flip() +
theme_classic() +
theme(
axis.line = element_line(size = 1, colour = "black"),
text = element_text(size = 20),
plot.title = element_text(hjust = 0.5),
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_text(angle = 45, hjust = 1, colour = "black"), # X-axis font color
axis.text.y = element_text(colour = "black") # Y-axis font color
) +
ggtitle("MTAP Expression by Cell Type in AKI") +
xlab(label = "")##
## Healthy Reference AKI CKD
## 30-10018 0 1548 0
## 30-10034 0 528 0
## 30-10123 0 373 0
## 30-10125 0 637 0
## 32-10003 0 605 0
## 32-10034 0 372 0
## 32-10074 0 1057 0
## 33-10005 0 906 0
## 33-10006 0 190 0
## 34-10050 0 1341 0
## 34-10184 0 202 0
## 34-10187 0 514 0
## PRE018-1 212 0 0
## PRE019-4 168 0 0
## PRE027 492 0 0
## PRE038 1046 0 0
## PRE055-1 108 0 0
## PRE062-1 96 0 0
## PRE19-025 273 0 0
## PRE19-05 125 0 0
## PRE98sc 244 0 0
## Sample1153-EO1 142 0 0
## Sample1153-EO2 69 0 0
## Sample1153-EO3 187 0 0
## Sample1157-EO1 247 0 0
## Sample1157-EO2 473 0 0
## Sample1157-EO3 225 0 0
## Sample1158-EO1 21 0 0
## Sample1158-EO2 182 0 0
## Sample1158-EO3 145 0 0
## Sample1162-EO1 333 0 0
## Sample1162-EO2 371 0 0
# Create the contingency table
enrollment_table <- table(KPMP_subset@meta.data$SpecimenID, KPMP_subset@meta.data$Enrollment.Category)
# Count the number of unique samples (rows with non-zero entries) for each category
sample_counts <- colSums(enrollment_table > 0)
print(sample_counts)## Healthy Reference AKI CKD
## 20 12 0
## [1] "2024-12-08 13:51:41 PST"
## R version 4.3.1 (2023-06-16 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 11 x64 (build 22631)
##
## Matrix products: default
##
##
## locale:
## [1] LC_COLLATE=English_United States.utf8
## [2] LC_CTYPE=English_United States.utf8
## [3] LC_MONETARY=English_United States.utf8
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.utf8
##
## time zone: America/Los_Angeles
## tzcode source: internal
##
## attached base packages:
## [1] grid stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] ggvenn_0.1.10 gplots_3.2.0 openxlsx_4.2.5.2
## [4] SeuratData_0.2.2.9001 viridis_0.6.4 viridisLite_0.4.2
## [7] RColorBrewer_1.1-3 ggupset_0.3.0 ggpmisc_0.5.4-1
## [10] ggpp_0.5.4 gghighlight_0.4.0 ggrepel_0.9.5
## [13] geneName_0.2.3 lubridate_1.9.2 forcats_1.0.0
## [16] stringr_1.5.1 purrr_1.0.2 readr_2.1.5
## [19] tidyr_1.3.1 tibble_3.2.1 tidyverse_2.0.0
## [22] paletteer_1.5.0 here_1.0.1 ggplot2_3.5.1
## [25] knitr_1.45 SeuratDisk_0.0.0.9021 SeuratObject_5.0.1
## [28] Seurat_4.4.0 dplyr_1.1.4
##
## loaded via a namespace (and not attached):
## [1] RcppAnnoy_0.0.22 splines_4.3.1 later_1.3.1
## [4] bitops_1.0-7 polyclip_1.10-6 lifecycle_1.0.4
## [7] rprojroot_2.0.4 globals_0.16.2 lattice_0.21-8
## [10] hdf5r_1.3.8 MASS_7.3-60 magrittr_2.0.3
## [13] plotly_4.10.4 sass_0.4.9 rmarkdown_2.25
## [16] jquerylib_0.1.4 yaml_2.3.7 httpuv_1.6.11
## [19] sctransform_0.4.1 spam_2.10-0 zip_2.3.0
## [22] sp_2.1-3 spatstat.sparse_3.0-3 reticulate_1.34.0
## [25] cowplot_1.1.3 pbapply_1.7-2 abind_1.4-5
## [28] Rtsne_0.17 rappdirs_0.3.3 irlba_2.3.5.1
## [31] listenv_0.9.1 spatstat.utils_3.0-4 MatrixModels_0.5-3
## [34] goftest_1.2-3 spatstat.random_3.2-2 fitdistrplus_1.1-11
## [37] parallelly_1.36.0 leiden_0.4.3.1 codetools_0.2-19
## [40] tidyselect_1.2.0 farver_2.1.1 matrixStats_1.2.0
## [43] spatstat.explore_3.2-5 jsonlite_1.8.8 ellipsis_0.3.2
## [46] progressr_0.14.0 ggridges_0.5.6 survival_3.5-5
## [49] tools_4.3.1 ica_1.0-3 Rcpp_1.0.12
## [52] glue_1.7.0 gridExtra_2.3 xfun_0.40
## [55] withr_3.0.0 BiocManager_1.30.22 fastmap_1.1.1
## [58] fansi_1.0.4 SparseM_1.81 caTools_1.18.2
## [61] digest_0.6.33 timechange_0.2.0 R6_2.5.1
## [64] mime_0.12 colorspace_2.1-0 Cairo_1.6-1
## [67] scattermore_1.2 gtools_3.9.5 tensor_1.5
## [70] spatstat.data_3.0-4 utf8_1.2.3 generics_0.1.3
## [73] data.table_1.14.10 httr_1.4.7 htmlwidgets_1.6.2
## [76] uwot_0.1.16 pkgconfig_2.0.3 gtable_0.3.4
## [79] lmtest_0.9-40 htmltools_0.5.8.1 dotCall64_1.1-1
## [82] scales_1.3.0 png_0.1-8 rstudioapi_0.15.0
## [85] tzdb_0.4.0 reshape2_1.4.4 nlme_3.1-162
## [88] cachem_1.0.8 zoo_1.8-12 KernSmooth_2.23-21
## [91] vipor_0.4.5 parallel_4.3.1 miniUI_0.1.1.1
## [94] ggrastr_1.0.2 pillar_1.9.0 vctrs_0.6.5
## [97] RANN_2.6.1 promises_1.2.1 xtable_1.8-4
## [100] cluster_2.1.4 beeswarm_0.4.0 evaluate_0.23
## [103] cli_3.6.1 compiler_4.3.1 rlang_1.1.1
## [106] crayon_1.5.2 future.apply_1.11.1 labeling_0.4.3
## [109] rematch2_2.1.2 ggbeeswarm_0.7.2 plyr_1.8.9
## [112] stringi_1.7.12 deldir_2.0-2 munsell_0.5.0
## [115] lazyeval_0.2.2 spatstat.geom_3.2-8 quantreg_5.97
## [118] Matrix_1.6-5 hms_1.1.3 patchwork_1.2.0
## [121] bit64_4.0.5 future_1.33.1 shiny_1.8.0
## [124] highr_0.10 ROCR_1.0-11 igraph_1.6.0
## [127] bslib_0.8.0 fastmatch_1.1-4 bit_4.0.5
## [130] polynom_1.4-1